/*
 * @Description: 原数据管理标签栏切换
 * @Author: Rfan
 * @Date: 2022-01-21 09:13:35
 * @LastEditTime: 2022-04-22 16:40:43
 */

import { Empty, Tabs } from 'antd';
import classNames from 'classnames/bind';
import ArcTypePane from './ArcTypePane';
import { useArcTypeContext } from '../contexts/ArcTypeContext';

import styles from '../styles/arcTypeWrap.module.scss';

const { TabPane } = Tabs;

const cx = classNames.bind(styles);
const ArcTypeWrap = () => {
  const { ATList } = useArcTypeContext();
  return (
    <div className={cx('arc-type-wrap')}>
      {ATList && ATList.length > 0 ? (
        <Tabs tabPosition="left">
          {ATList.map((arcType: any) => (
            <TabPane tab={arcType.atName} key={arcType.id}>
              <ArcTypePane data={arcType} />
            </TabPane>
          ))}
        </Tabs>
      ) : (
        <Empty className={cx('empty-at')} description="目前此全宗下还没有档案类型哦" />
      )}
    </div>
  );
};

export default ArcTypeWrap;
